* image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 07:05:17 +0000 (00:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 07:05:17 +0000 (00:05 -0700)
This is needed if max-image-size is a floating-point number.

src/ChangeLog
src/image.c

index 8e562c78c975b48693755ca0d849f284db5eb90c..9019a4061a814d3bc43861889b249e775f4441f9 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
+       This is needed if max-image-size is a floating-point number.
+
 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
 
        * print.c (print_object): Print empty symbol as ##.
index fb1d825fa5484a8a0aa236978bc9ae00761d44b8..d1091aec6f319320f1ccb732c889e65c0315c021 100644 (file)
@@ -1053,9 +1053,13 @@ check_image_size (struct frame *f, int width, int height)
            && height <= XINT (Vmax_image_size));
   else if (FLOATP (Vmax_image_size))
     {
-      xassert (f);
-      w = FRAME_PIXEL_WIDTH (f);
-      h = FRAME_PIXEL_HEIGHT (f);
+      if (f != NULL)
+       {
+         w = FRAME_PIXEL_WIDTH (f);
+         h = FRAME_PIXEL_HEIGHT (f);
+       }
+      else
+       w = h = 1024;  /* Arbitrary size for unknown frame. */
       return (width <= XFLOAT_DATA (Vmax_image_size) * w
              && height <= XFLOAT_DATA (Vmax_image_size) * h);
     }